import django_filters
from .models import User, Specialization


class UserFilter(django_filters.FilterSet):
    class Meta:
        model = User
        fields = {
            'first_name': ['exact', 'icontains'],
            'second_name': ['exact', 'icontains'],
            'last_name': ['exact', 'icontains'],
            'create_date': ['gte', 'lte'],

            'main_specialization__specialization': ['exact', 'icontains'],
            'additional_specializations__specialization': ['exact', 'icontains'],
        }


class SpecializationFilter(django_filters.FilterSet):
    class Meta:
        model = Specialization
        fields = {
            'specialization': ['exact', 'icontains'],
        }
